﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PServiceBus.Services.Gateway.Runtime {
    internal class ExceptionConstants {
        internal const string EVENT_INVALID = "Topic[{0}] is in invalid state and un-useable because it is currently not registered";
        internal const string SUBSCRIBER_INVALID = "Subscriber[{0}] is in invalid state and un-useable because it does not exist";

        internal static string TopicExceptionStr(string topicName) {
            return String.Format(EVENT_INVALID, topicName);
        }

        internal static string SubscriberExceptionStr(string subscriberName) {
            return String.Format(SUBSCRIBER_INVALID, subscriberName);
        }
        internal static string AuthenticationExceptionStr(string username) {
            return String.Format("Authentication failed for User[{0}]", username);
        }
        internal static string AuthorizationExceptionStr(string username, string action) {
            return String.Format("User[{0}] Authorization failed for action[{1}]", username, action);
        }
    }
}
